<?php
/**
 * Interface zum Db_Connector
 *
 * @author		Joachim Ruf
 * @copyright	Copyright (c) 2003-2010 Loresoft Software (http://www.loresoft.de)
 * @license		http://yapary.loresoft.de/lizenzbedingungen     New BSD License
 *
 * */


class Yapary_Db_Sql_TableRow Implements Yapary_Db_ITableRow
{
    private $tableName    = NULL;
    private $connection   = NULL;


    function __construct ($_connection, $_tableName) {
        $this->connection = $_connection;
        $this->tableName  = $_tableName;
    }


    /**
     * Liefert die Anzahl vorhandener Zeilen
     * @return int
     * */
    public function getCount () {
		$resId = @mysql_query('SELECT COUNT(*) AS COUNTER FROM ="'.$this->tableName.'"', $this->connection);
		if (gettype($resId) !== 'resource') {
		    return 0;
		    //trigger_error('FATAL ERROR in <b>'.__METHOD__.'</b> TMP data does not exist', E_USER_ERROR);
		}

	    return (int) @mysql_num_rows($resId);
    }

}


?>